//
//  Request.m
//  PigMarket
//
//  Created by Felix on 2019/4/11.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "Request.h"

@implementation Request

- (instancetype)initWithURLString:(NSString *) URLString
                           method:(NSString *) method
                        oauthType:(enum OAuthType) oauthType {
    
    return [self initWithURLString:URLString method:method oauthType:oauthType header:nil param:nil];
}

- (instancetype)initWithURLString:(NSString *) URLString
                           method:(NSString *) method
                        oauthType:(enum OAuthType) oauthType
                            param:(nullable id) param {
    return [self initWithURLString:URLString method:method oauthType:oauthType header:nil param:param];
}

- (instancetype)initWithURLString:(NSString *) URLString
                           method:(NSString *) method
                        oauthType:(enum OAuthType) oauthType
                           header:(nullable NSDictionary<NSString *,NSString *> *) headers
                            param:(nullable id) param {
    
    self = [super init];
    if (self) {
        self.URLString = URLString;
        self.method = method;
        self.oauthType = oauthType;
        self.headers = headers;
        self.param = param;
    }
    return self;
}


+ (instancetype)requestWithURLString:(NSString *) URLString
                              method:(NSString *) method
                           oauthType:(enum OAuthType) oauthType {
    
    return [self requestWithURLString:URLString method:method oauthType:oauthType header:nil param:nil];
}

+ (instancetype)requestWithURLString:(NSString *) URLString
                              method:(NSString *) method
                           oauthType:(enum OAuthType) oauthType
                               param:(nullable id) param {
    return [self requestWithURLString:URLString method:method oauthType:oauthType header:nil param:param];
}

+ (instancetype)requestWithURLString:(NSString *) URLString
                              method:(NSString *) method
                           oauthType:(enum OAuthType) oauthType
                              header:(nullable NSDictionary<NSString *,NSString *> *) headers
                               param:(nullable id) param {
    return [[Request alloc] initWithURLString:URLString method:method oauthType:oauthType header:headers param:param];
}


-(NSString *)description {
    return [self yy_modelDescription];
}

@end
